%{
#include <stdlib.h>
#include <string.h>
#include "wiki2epub.tab.h"


%}
space		\x20
vbar		\|
jump		\n
sharp		\#
ital 	\x27{2}
bold 	\x27{3}
itbol  	\x27{5}
tit     	={2}
stit		={3}
sstit		={4}
ilink		(\[\[)|(\[\[:)	
flink		\]\]
itarget		\{\{
ftarget		\}\}
iref		\&lt\;ref
fref		\&lt\;\/ref\>|\/\>
ifile		\[\[{space}*((?i:file)|(?i:archivo)|(?i:imagen)|(?i:image)){space}*:
word		[0-9a-zA-Zá-úÁ-ÚñÑ\.\:\,\; \t\r\(\)\-\_\!\¡\º\ª\+]+

%%	
{jump}		{return JUMP;}
{vbar}		{return VBAR;}
{sharp}		{return SHARP;}
{ital}		{return ITAL;}
{bold}		{return BOLD;}
{itbol}		{return ITBOLD;}
{tit}		{return TIT;}
{stit}		{return STIT;}
{sstit}		{return SSTIT;}
{ilink}		{return ILINK;}
{flink}		{return FLINK;}
{ifile}		{return IFILE;}
{itarget}	{return ITARGET;}
{ftarget}	{return FTARGET;}
{iref}		{return IREF;}
{fref}		{return FREF;}
{word}		{yylval.valChar = strdup(yytext);return WORD;}
. {}

%%
